﻿function TaskFactory($q, $http) {
    var GetAllTasks = function () {
        var deferred = $q.defer();
        $http({
            url: '/api/apiToDoes',
            method: 'GET'
        }).success(function (data) {
            deferred.resolve(data);
        }).error(function (data) {
            deferred.reject(data);
        });
        return deferred.promise;
    }

    return {
        GetAllTasks: GetAllTasks
    }
}
TaskFactory.$inject = ['$q', '$http'];